import React from 'react';
import { useNavigate } from 'react-router-dom';
import './style.scss';

const Home: React.FC = () => {
  const navigate = useNavigate();

  const handleLogout = () => {
    // 清除登录状态
    localStorage.removeItem('token');
    // 跳转到登录页
    navigate('/login');
  };

  return (
    <div className="home-container">
      <header className="home-header">
        <h1>首页</h1>
        <nav className="nav-menu">
          <a href="#dashboard">控制台</a>
          <a href="#profile">个人信息</a>
          <a href="#settings">设置</a>
          <button className="logout-button" onClick={handleLogout}>
            退出登录
          </button>
        </nav>
      </header>
      <main className="main-content">
        <div className="welcome-section">
          <h2>欢迎回来</h2>
          <p>这里是您的个人工作台</p>
        </div>
      </main>
    </div>
  );
};

export default Home; 